home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / hack / 3_1_3 / sys / amiga / amitty.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-24  |  1.5 KB  |  66 lines

  1. /*    SCCS Id: @(#)amitty.c     3.1    93/01/08
  2. /*    Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993      */
  3. /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5. /* TTY-specific code for the Amiga */
  6.  
  7. /* Still to do:
  8.  * add command line switches for enough control to use as BBS door
  9.  * add realy termcap handling - currently requires ANSI_DEFAULT
  10.  * fix tids everywhere
  11.  * fix commented out code that tries (and fails) to avoid problems with
  12.  *  typeahead - we may need to resort to basic packet I/O. Sigh.
  13.  * prototype and related cleanup
  14.  */
  15.  
  16. #include "hack.h"
  17. #include "termcap.h"
  18. #include <stdio.h>
  19.  
  20. void NDECL( get_scr_size );
  21. void NDECL( tty_change_color );
  22. char *NDECL( tty_get_color_string );
  23.  
  24. #ifdef TTY_GRAPHICS
  25. void settty(const char *s){
  26.     end_screen();
  27.     if(s)raw_print(s);
  28.     flags.cbreak=ON;    /* this is too easy: probably wrong */
  29. #if 0 /* should be version>=36 */
  30.     if(IsInteractive(Input())){
  31.         SetMode(Input(),0);    /* con mode */
  32.     }
  33. #endif
  34. }
  35. void gettty(){
  36. #if 0 /* should be VERSION >=36 */
  37.     if(IsInteractive(Input())){
  38.         SetMode(Input(),1);    /* raw mode */
  39.     }
  40. #endif
  41. }
  42. void setftty(){
  43.     flags.cbreak=ON;    /* ditto */
  44. }
  45. char kill_char='X'-'@';
  46. char erase_char='\b';
  47. tgetch(){
  48. #if 1
  49.     int x=getch();        /* can't use getch() - typeahead ends up stalling the
  50.                  * game (since it's a con:) */
  51. #else
  52.     int x;
  53.     Read(Input(),&x,1);
  54. #endif
  55.     return (x=='\r')?'\n':x;
  56. }
  57. void get_scr_size(){
  58.     CO=80;
  59.     LI=24;
  60. }
  61.  
  62. #endif
  63.  
  64. void tty_change_color() {}
  65. char *tty_get_color_string() { return( "" ); }
  66.